using System;
using System.Diagnostics;
using UnityEngine;
using UnityEngine.Rendering;

/// <summary>
/// A <see cref="VolumeParameter"/> that holds a <c>Texture</c> value.
/// </summary>
[Serializable, DebuggerDisplay(k_DebuggerDisplay)]
public class Texture3DParameter : VolumeParameter<Texture3D>
{
    /// <summary>
    /// Creates a new <seealso cref="TextureParameter"/> instance.
    /// </summary>
    /// <param name="value">The initial value to store in the parameter.</param>
    /// <param name="overrideState">The initial override state for the parameter.</param>
    public Texture3DParameter(Texture3D value, bool overrideState = false)
        : base(value, overrideState) { }

    // TODO: Texture interpolation

    /// <summary>
    /// Returns a hash code for the current object.
    /// </summary>
    /// <returns>A hash code for the current object.</returns>
    public override int GetHashCode()
    {
        int hash = base.GetHashCode();

        unchecked
        {
            if (value != null)
                hash = 23 * CoreUtils.GetTextureHash(value);
        }

        return hash;
    }
}